home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_teo_doorcam.cog < prev    next >
Text File  |  1999-11-15  |  5KB  |  164 lines

  1. # Jones 3D Cog Script
  2. #
  3. # gen_DoorCam.cog
  4. #
  5. # This is the generic door with a camera attached
  6. #
  7. # [SXC]
  8. #
  9. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.     message     startup
  14.     message     activate
  15.     message     blocked      
  16.                 
  17.     thing       ghostcampos0
  18.     thing       ghostcampos1
  19.     thing        switch0                       //switch on one side of the door
  20.     thing        switch1                       //switch on the other side of the door (optional)
  21.     thing       door0
  22.     thing       player          local
  23.    
  24.     sector      doorsector
  25.    
  26.     flex        doorspeed=1.0
  27.     flex        switchspeed=2.0
  28.     flex        waittime=5.0
  29.                  
  30.     int            flag=0          local
  31.     int         blockcheck=0    local
  32.     int         actcheck=0      local
  33.     int         firsttime0=0    local
  34.     int         firsttime1=0    local    
  35.     int         wepnum=1        local
  36.     int         lastrand=-1     local
  37.     int         currand=0       local
  38.     
  39.     sound       indylineb0=inxj058.wav      local
  40.     sound       indylineb1=inxj059.wav      local
  41.     sound       indylineb2=inxj060.wav      local
  42.     sound       indylineb3=inxj061.wav      local
  43.     sound       indylineb4=inxj090.wav      local
  44.     sound       indylineb5=inxj095.wav      local
  45.     
  46. end
  47.  
  48. # ========================================================================================
  49.  
  50. code
  51.  
  52. startup:
  53.  
  54.     player = GetLocalPlayerThing();
  55.     SetSectorAdjoins(doorsector, 0);
  56.     
  57. return;
  58.  
  59. #........................................................................................
  60. activate:
  61.  
  62.     if ((GetSenderRef() == switch0) && (actcheck == 0) && (GetCurItem(player) == 0))
  63.     {
  64.         actcheck = 1;
  65.         While(wepnum !=0)
  66.         {
  67.             wepnum = GetCurWeapon(player);
  68.             DeselectWeaponWait(player);
  69.             DeselectWeapon(player);
  70.             //printint(wepnum);
  71.         }
  72.         StartCutscene(1);
  73.         StopThing(player);                                                     
  74.         SetActorFlags(player, 0x200000);
  75.         SetExtCamOffsetToThing(2, ghostcampos0);
  76.         firsttime0 = 1;
  77.         PlayMode(player, 60, 0);
  78.         Sleep(0.25);
  79.         MoveToFrame(switch0, 1, switchspeed);
  80.         WaitForStop(switch0);
  81.         MoveToFrame(door0, 1, doorspeed);
  82.         ClearActorFlags(player, 0x200000);
  83.         SetSectorAdjoins(doorsector, 1);
  84.         WaitForStop(door0);
  85.         EndCutscene();
  86.         RestoreExtCam();
  87.         
  88.         Sleep(10);
  89.         MoveToFrame(switch0, 0, switchspeed);
  90.         MoveToFrame(door0, 0, doorspeed);
  91.         WaitForStop(door0);
  92.         actcheck = 0;
  93.         wepnum = 1;
  94.         return;
  95.     }
  96.     
  97.     if ((GetSenderRef() == switch1) && (actcheck == 0) && (GetCurItem(player) == 0))
  98.     {
  99.         actcheck = 1;
  100.         While(wepnum !=0)
  101.         {
  102.             wepnum = GetCurWeapon(player);
  103.             DeselectWeaponWait(player);
  104.             DeselectWeapon(player);
  105.             //printint(wepnum);
  106.         }
  107.         StartCutscene(1);
  108.         StopThing(player);                                                     
  109.         SetActorFlags(player, 0x200000);
  110.         SetExtCamOffsetToThing(2, ghostcampos1);
  111.         PlayMode(player, 60, 0);
  112.         Sleep(0.25);
  113.         MoveToFrame(switch1, 1, switchspeed);
  114.         WaitForStop(switch1);
  115.         MoveToFrame(door0, 1, doorspeed);
  116.         ClearActorFlags(player, 0x200000);
  117.         SetSectorAdjoins(doorsector, 1);
  118.         WaitForStop(door0);
  119.         EndCutscene();
  120.         RestoreExtCam();
  121.         Sleep(10);
  122.         MoveToFrame(switch1, 0, switchspeed);
  123.         MoveToFrame(door0, 0, doorspeed);
  124.         WaitForStop(door0);
  125.         actcheck = 0;
  126.         wepnum = 1;
  127.         return;
  128.     }
  129.     
  130.     if ((GetCurItem(player) != 0) && (GetSenderID() == 1))
  131.     {
  132.         StopThing(player);
  133.         StartCutscene(1);
  134.         SetActorFlags(player, 0x200000);
  135.         currand = RandBetween(0, 5);
  136.         While (lastrand == currand)
  137.         {
  138.             currand = RandBetween(0, 5);
  139.         }
  140.         PlayVoice(player, indylineb0[currand], 1, 1);
  141.         lastrand = currand;
  142.         EndCutscene();
  143.         ClearActorFlags(player, 0x200000);
  144.     }
  145.     
  146.     return;
  147.     
  148. #........................................................................................
  149. blocked:
  150.     if (GetSenderRef() == door0);
  151.     {
  152.         MoveToFrame(switch0, 1, switchspeed);
  153.         MoveToFrame(switch1, 1, switchspeed);
  154.         MoveToFrame(door0, 1, doorspeed);
  155.         WaitForStop(door0);
  156.         SetTimer(10);
  157.     }
  158.     return;
  159.         
  160.  
  161. end
  162.  
  163.  
  164.